﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;

namespace NoResponseAlarm.Service //Interfaces
{    
    [ServiceContract]
    public interface INoResponseRegistrar //TestEventRegistrar
    {
        [OperationContract]
        void RegisterEvent(CheckEventData eventData);
    }
    public enum CheckResult //TestResult
    {
        RequestSucceed = 0,
        NoResponse = 2, //Server is not responding, request failed, DestinationUnreachable (not reachable)
        InvalidResponse = 3, //Invalid HTML
        PingTimedOut = 1
    }

    [DataContract]
    public class CheckEventData //CheckEventPOCO
    {
        CheckResult operationResult;
        DateTime timeStamp;
        string source; //Checker/Tester/Client
        string target; //Destination
        string userName;
        string extras;
        
        [DataMember]
        public CheckResult OperationResult
        {
            get { return operationResult; }
            set { operationResult = value; }
        }
        [DataMember]
        public DateTime TimeStamp
        {
            get { return timeStamp; }
            set { timeStamp = value; }
        }
        public DateTime TimeStampSQL
        {
            get { return timeStamp; }
        }
        [DataMember]
        public string Source
        {
            get { return source; }
            set { source = value; }
        }
        [DataMember]
        public string Target
        {
            get { return target; }
            set { target = value; }
        }
        [DataMember]
        public string UserName
        {
            get { return userName; }
            set { userName = value; }
        }
        [DataMember]
        public string Extras
        {
            get { return extras; }
            set { extras = value; }
        }
        //TestPerformed        
        //Conclusion
        //Inquery
    }
}
